# -*- coding: utf-8 -*-
from django.conf.urls.defaults import *
from django.contrib.syndication.views import feed
from feeds import UserEntries, LatestEntries
urlpatterns = patterns('bvblogapp.views',                                              
    url(r'^latest/$', 'latests_posts', name='latests_posts'),
    url(r'^$', 'latests_posts', name='latests_posts_main'),
    url(r'^users/$', 'users', name='users_with_analyses'),
    url(r'^(?P<username>[\d\w_-]+)/index/$', 'index', name='blog_index'),
    url(r'^public/tag/(?P<tagname>[\d\w\s\.]+)/$', 'search_by_public_tag', name='search_by_public_tag'),
    url(r'^(?P<username>[\d\w_-]+)/tag/(?P<tagname>[\d\w\s\.]+)/$', 'search_by_tag', name='search_by_tag'),    
    url(r'^(?P<username>[\d\w_-]+)/read/(?P<post_key>\d+)/comments/add/$', 'add_comment', name='blog_post_add_comment'),
    url(r'^(?P<username>[\d\w_-]+)/read/(?P<post_key>\d+)/comments/delete/(?P<comment_id>\d+)/$', 'delete_comment', name='blog_post_delete_comment'),
    url(r'^(?P<username>[\d\w_-]+)/read/(?P<post_key>\d+)/$', 'read', name='blog_post_read'),
    url(r'^(?P<username>[\d\w_-]+)/update/(?P<post_key>\d+)/$', 'update', name='blog_update'),
    url(r'^(?P<username>[\d\w_-]+)/update/$', 'update', name='blog_create'),
    url(r'^(?P<username>[\d\w_-]+)/delete/(?P<post_key>\d+)/$', 'delete', name='blog_post_delete'),
    url(r'^feeds/(?P<url>.*)/$', feed, {'feed_dict': {'user': UserEntries, 'latest': LatestEntries}}),
    url(r'^(?P<username>[\d\w_-]+)/$', 'index', name='blog_index'),
)
